#include <iostream>
#include <memory>
using std::cout;
using std::endl;
using std::auto_ptr;

void test0(){
    auto_ptr<int> ap(new int(10));
    cout << "*ap:" << *ap << endl;

    cout << endl;
    //调用auto_ptr的拷贝构造
    //但是底层实际的处理方式是移交管理权给ap2
    auto_ptr<int> ap2(ap);
    cout << "*ap2:" << *ap2 << endl;
    /* cout << "*ap:" << *ap << endl; */
}

int main(void){
    test0();
    return 0;
}
